<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <title>Document</title>
  </head>
  <body>
    <script>
      var sum = function (num1, num2) {		// 函数表达式
        return num1 + num2;
      };
      console.log(sum(1, 2));					    // 调用函数，输出结果：3
    </script>
  </body>
</html>